package com.atlzk.seckill.seckill.dao;

import com.atlzk.seckill.seckill.entity.SeckillEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * 
 * 
 * @author liuzekun
 * @email 2803587841@gmail.com
 * @date 2021-06-30 16:41:32
 */
@Mapper
public interface SeckillDao extends BaseMapper<SeckillEntity> {

    @Update("UPDATE seckill set stock_count = stock_count -1 where  id = 1 and stock_count > 0")
    int subtractStockCount(Long seckillId);
}
